﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace LeakView.misc.view.controls
{
    public partial class HistoryTimeRanger : UserControl
    {
        public HistoryTimeRanger()
        {
            InitializeComponent();
            this.comboBox1.SelectedIndex = 0;
            this.comboBox2.SelectedIndex = 24;
        }

        public DateTime Date
        {
            get => this.dateTimePickerStart.Value.Date;
        }

        public int HourStart
        {
            get => this.comboBox1.SelectedIndex;
        }

        public int HourEnd
        {
            get => this.comboBox2.SelectedIndex;
        }

        public DateTime StartTime
        {
            get => Date.AddHours(HourStart);
        }

        public DateTime EndTime
        {
            get => Date.AddHours(HourEnd);
        }

        public bool IsValid
        {
            get => HourEnd >= HourStart;
        }

    }
}
